import request from '@/utils/request'

// 查询库存记录列表
export function listStockRecord(query) {
  return request({
    url: '/system/record/list',
    method: 'get',
    params: query
  })
}

// 查询库存记录详细
export function getStockRecord(id) {
  return request({
    url: '/system/record/' + id,
    method: 'get'
  })
}

// 新增库存记录
export function addStockRecord(data) {
  return request({
    url: '/system/record',
    method: 'post',
    data: data
  })
}

// 修改库存记录
export function updateStockRecord(data) {
  return request({
    url: '/system/record',
    method: 'put',
    data: data
  })
}

// 删除库存记录
export function delStockRecord(id) {
  return request({
    url: '/system/record/' + id,
    method: 'delete'
  })
}

// 导出库存记录
export function exportStockRecord(query) {
  return request({
    url: '/system/record/export',
    method: 'get',
    params: query
  })
}

// 获取月度库存变化趋势数据
export function getMonthlyStockTrend() {
  return request({
    url: '/system/record/monthlyTrend',
    method: 'get'
  })
} 